<div id="actionbar" class="fn-clear">
    <div class="fn-left">
        <button class="button button-red bar" url="{:url('vip.coupon/coupon',['id' => $id])}" msg="您确认要关联已选优惠券吗？"><i class="iconfont icon-lianjie"></i>确认关联优惠券</button> 
    </div>
    <div class="fn-right">
    <form id="form" action="{:url('vip.coupon/coupon')}" method="get">
        <input type="hidden" name="id" value="{$id}" />
        <input placeholder="请输入用户优惠券名称" class="input w200" type="text" name="keyword" value="{$keyword}" /><input type="submit" value="搜索" class="button button-blue" />
    </form>
    </div>
</div>
<table class="table table-border">
    <thead>
        <tr>
            <th class="w60 fn-tac"><input type="checkbox" onclick="CheckAll(this)"></th>
            <th>优惠券信息</th>
            <th class="w90 fn-tac">类型</th>
            <th class="w90 fn-tar">满用(￥)</th>
            <th class="w90 fn-tar">代金/折扣</th>
            <th class="w120 fn-tac">更新日期</th>
            <th class="w60 fn-tac">状态</th>
            <th class="w150 fn-tac">操作</th>
        </tr>
    </thead>
    <tbody>
        {foreach $lists as $vo}
        <tr>
            <td class="fn-tac"><input name="ids[]" type="checkbox" value="{$vo.id}"></td>
            <td>
                <i class="iconfont icon-discount"></i><span class="selectID fn-cp fn-fb" url="{:url('coupon/review',['id'=>$vo.id])}">{$vo.name}</span><br />
                <span class="gray"><i class="iconfont icon-wodedingdan2"></i>{$vo.tips}</span><br />
                <span class="selectID fn-cp" url="{:url('store.index/review',['id'=>$vo.store.id])}"><i class="iconfont icon-store_icon"></i>{$vo.store.name}</span>
            </td>
            <td class="fn-tac">{$vo.types == 1 ?'折扣券':'代金券'} </td>
            <td class="fn-tar"><i class="iconfont icon-renminbi1688"></i>{$vo.howmuch|money}</td>
            <td class="fn-tar">{if $vo.types}{$vo.discount}折{else}￥{$vo.price}{/if}</td>
            <td class="fn-tac">{$vo.update_time|date="Y-m-d"}</td>
            <td class="fn-tac">
                {if $vo.is_end}
                    <span class="fn-cp istop badge bg-red" url="{:url('coupon/isend',['id'=>$vo.id])}" title="过期/领完">失效</span>
                {else}
                    <span class="fn-cp istop badge {$vo.is_lock?'bg-green':''}" url="{:url('coupon/islock',['id'=>$vo.id])}">{$vo.is_lock?'未审':'已审'}</span><br />
                    <span class="fn-cp istop badge {$vo.is_top?'bg-blue':''}" url="{:url('coupon/istop',['id'=>$vo.id])}">{$vo.is_top?'推荐':'推荐'}</span>
                {/if}
            </td>
            <td class="button-group">
                <a class="button button-mini" href="{:url('coupon/edit',['id'=>$vo.id])}"><i class="iconfont icon-edit"></i>编辑</a>
                <a class="button button-mini isDel" url="{:url('coupon/delete',['id'=>$vo.id])}" href="javascript:;" title="删除"><i class="iconfont icon-lajixiang"></i>删除</a>
            </td>
        </tr>
        {/foreach}
    </tbody>
</table>
{$lists|raw}
<script type="text/javascript">
Do('base','layer',function(){
    $(".bar").click(function() {
        var url = $(this).attr('url');
        var msg = $(this).attr('msg');
        tools_submit({action:url,msg:msg})
    })
})
</script>